﻿<%@ Page Language="C#" Theme="PAT_Theme" MasterPageFile="~/master/PAT.master" AutoEventWireup="true" CodeFile="ReporteCitas.aspx.cs" Inherits="aspx_rep01_ReporteCitas" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="WebChart" Namespace="WebChart" TagPrefix="Web" %>

<asp:Content Id="headerContent" ContentPlaceHolderID="headerContent" runat="server">
    <script language="javaScript" type="text/javascript" src="../../common/FusionCharts.js"></script>
    <script language="javascript">
        function evtGenerarReporteCitas(){
            PageMethods.GenerarReporteCitas($get("<%=ddlEstadoCita.ClientID %>").value, $get("<%=txtFechaInicio.ClientID %>").value, $get("<%=txtFechaFinal.ClientID %>").value, $get("<%=ddlTaller.ClientID %>").value, OnSucceededGenerarReporteCitas, OnFailedGenerarReporteCitas);
        }
                
        function OnSucceededGenerarReporteCitas(result) {
            var aChart = new FusionCharts("../../swf/ScrollColumn2D.swf","idChartCitasTaller","800","600","0","0");
            aChart.setDataXML(result);
            aChart.render("divReportResult");
            /*$get("upProgess").style.display = 'none';*/            
        }
        
        function OnFailedGenerarReporteCitas(error) {
            alert("Stack Trace: " + error.get_stackTrace() + "\r\n" + "Error: " + error.get_message() + "\r\n" + "Status Code: " + error.get_statusCode() + "\r\n" + "Exception Type: " + error.get_exceptionType() + "\r\n" + "Timed Out: " + error.get_timedOut()); 
            /*$get("upProgess").style.display = 'none';*/
        }
    </script>
</asp:Content>

<asp:Content ID="mainContent" ContentPlaceHolderID="mainContent" Runat="Server">
    <table width="100%" border="0" cellspacing="1" cellpadding="1">
        <tr>
            <td colspan="4"><h1>Reporte de citas de taller</h1></td>
        </tr>
        <tr>
            <td>Fecha Inicial:</td>
            <td>
                <asp:TextBox ID="txtFechaInicio" runat="server" meta:resourcekey="txtFechaInicioResource1"></asp:TextBox><asp:ImageButton ID="btnFechaInicio" ImageUrl="~/App_Themes/PAT_Theme/images/calendar.png" runat="server" meta:resourcekey="btnFechaInicioResource1" />
                <cc1:CalendarExtender ID="calFechaInicio" TargetControlID="txtFechaInicio" PopupButtonID="btnFechaInicio" runat="server">
                </cc1:CalendarExtender>
            </td>
            <td>Fecha Final:</td>
            <td>
                <asp:TextBox ID="txtFechaFinal" runat="server" meta:resourcekey="txtFechaFinalResource1"></asp:TextBox><asp:ImageButton ID="btnFechaFinal" ImageUrl="~/App_Themes/PAT_Theme/images/calendar.png" runat="server" meta:resourcekey="btnFechaFinalResource1" />
                <cc1:CalendarExtender ID="calFechaFinal" TargetControlID="txtFechaFinal" PopupButtonID="btnFechaFinal" runat="server">
                </cc1:CalendarExtender>
            </td>
        </tr>
        <tr>
            <td>Estado de cita:</td>
            <td>
                <asp:DropDownList ID="ddlEstadoCita" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>Taller:</td>
            <td>
                <asp:DropDownList ID="ddlTaller" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="4"><input id="btnGenerarReporteCitas" type="button" value="Generar Reporte" onclick="evtGenerarReporteCitas();" /></td>
        </tr>
    </table>
    <div id="divReportResult"></div>
</asp:Content>
